package com.heima.article.job;

import com.heima.article.service.HotArticleComputeService;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class HotArticleComputeScoreJob {

    @Autowired
    HotArticleComputeService hotArticleComputeService;

    /**
     * 计算热点文章，每天凌晨1点触发
     */
    @XxlJob("hotArticleJobHandler")
    public void computeArticleScore(){
        log.info("热点文章定时计算开始");
        hotArticleComputeService.computeHotArticle();
        log.info("热点文章定时计算介绍");
    }


}
